package com.bl.util;

import java.util.Date;

import com.bl.action.Command;

/**
 * @author ${user}
 */
public class LoggingCommandExecutor {

    public <T> T executeCommand(Command<T> aCommand, String aMessageToLog) {
        Date startTime = new Date();
        T result = aCommand.execute();
        Date endTime = new Date();
        System.out.println(aMessageToLog + (endTime.getTime() - startTime.getTime()));
        return result;
    }
}
